package com.aptech.DAO;

import com.aptech.domain.JPA.EventRequest;
import java.util.List;

/**
 * Interface for EventRequestDAO.
 * @author MyEclipse Persistence Tools
 */

public interface IEventRequestDAO {
		/**
	 Perform an initial save of a previously unsaved EventRequest entity. 
	 All subsequent persist actions of this entity should use the #update() method.
	 This operation must be performed within the a database transaction context for the entity's data to be permanently saved to the persistence store, i.e., database. 
	 This method uses the {@link javax.persistence.EntityManager#persist(Object) EntityManager#persist} operation.
	 	 <p>
	 User-managed Spring transaction example:
	 	 	 
	 * <pre> 
	 *   TransactionStatus txn = txManager.getTransaction(new DefaultTransactionDefinition());
	 *   IEventRequestDAO.save(entity);
	 *   txManager.commit(txn);
	 * </pre>
	 @see <a href = "http://www.myeclipseide.com/documentation/quickstarts/jpaspring#containermanaged">Spring container-managed transaction examples</a>
	   @param entity EventRequest entity to persist
	  @throws RuntimeException when the operation fails
	 */
    public void save(EventRequest entity);
    /**
	 Delete a persistent EventRequest entity.
	  This operation must be performed 
	 within the a database transaction context for the entity's data to be
	 permanently deleted from the persistence store, i.e., database. 
	 This method uses the {@link javax.persistence.EntityManager#remove(Object) EntityManager#delete} operation.
	 	 <p>
	 User-managed Spring transaction example:
	 	 	 
	 * <pre> 
	 *   TransactionStatus txn = txManager.getTransaction(new DefaultTransactionDefinition());
	 *   IEventRequestDAO.delete(entity);
	 *   txManager.commit(txn);
	 *   entity = null;
	 * </pre>
	 @see <a href = "http://www.myeclipseide.com/documentation/quickstarts/jpaspring#containermanaged">Spring container-managed transaction examples</a>
	   @param entity EventRequest entity to delete
	 @throws RuntimeException when the operation fails
	 */
    public void delete(EventRequest entity);
   /**
	 Persist a previously saved EventRequest entity and return it or a copy of it to the sender. 
	 A copy of the EventRequest entity parameter is returned when the JPA persistence mechanism has not previously been tracking the updated entity. 
	 This operation must be performed within the a database transaction context for the entity's data to be permanently saved to the persistence
	 store, i.e., database. This method uses the {@link javax.persistence.EntityManager#merge(Object) EntityManager#merge} operation.
	 	 <p>
	 User-managed Spring transaction example:
	 	 	 
	 * <pre> 
	 *   TransactionStatus txn = txManager.getTransaction(new DefaultTransactionDefinition());
	 *   entity = IEventRequestDAO.update(entity);
	 *   txManager.commit(txn);
	 * </pre>
	 @see <a href = "http://www.myeclipseide.com/documentation/quickstarts/jpaspring#containermanaged">Spring container-managed transaction examples</a>
	   @param entity EventRequest entity to update
	 @return EventRequest the persisted EventRequest entity instance, may not be the same
	 @throws RuntimeException if the operation fails
	 */
	public EventRequest update(EventRequest entity);
	public EventRequest findById( Integer id);
	 /**
	 * Find all EventRequest entities with a specific property value.  
	 
	  @param propertyName the name of the EventRequest property to query
	  @param value the property value to match
	  	  @param rowStartIdxAndCount Optional int varargs. rowStartIdxAndCount[0] specifies the  the row index in the query result-set to begin collecting the results. rowStartIdxAndCount[1] specifies the the maximum count of results to return.  
	  	  @return List<EventRequest> found by query
	 */
	public List<EventRequest> findByProperty(String propertyName, Object value
			, int...rowStartIdxAndCount
		);
	public List<EventRequest> findByStatus(Object status
			, int...rowStartIdxAndCount
		);
	public List<EventRequest> findByAddressId(Object addressId
			, int...rowStartIdxAndCount
		);
	/**
	 * Find all EventRequest entities.
	  	  @param rowStartIdxAndCount Optional int varargs. rowStartIdxAndCount[0] specifies the  the row index in the query result-set to begin collecting the results. rowStartIdxAndCount[1] specifies the the maximum count of results to return.  
	  	  @return List<EventRequest> all EventRequest entities
	 */
	public List<EventRequest> findAll(
			int...rowStartIdxAndCount
		);	
}